#pragma once

#include <string>
#include <vector>
#include <boost/property_tree/ptree.hpp>

namespace net_channel {
namespace client {

class Config {
public:
    struct ServerInfo {
        std::string address;
        uint16_t port;
    };

    struct ServiceInfo {
        std::string name;
        std::string local_address;
        uint16_t local_port;
        uint16_t remote_port;
        std::string protocol;  // "tcp" or "udp"
    };

    explicit Config(const std::string& config_file);

    const ServerInfo& get_server_info() const { return server_info_; }
    const std::vector<ServiceInfo>& get_services() const { return services_; }

private:
    bool parseConfig(const std::string& filepath);
    
    ServerInfo server_info_;
    std::vector<ServiceInfo> services_;
};

} // namespace client
} // namespace net_channel